import { ref, computed } from "vue";

import { defineStore } from "pinia";

const useCityStore = defineStore("city", () => {
  // 定义state
  const city = ref("北京");

  // 定义getters
  const getterCity = computed(() => {
    return city.value + "!!!!";
  });

  // 定义actions
  const changeCity = () => {
    city.value = "上海";
  };

  return { city, getterCity, changeCity };
});

export default useCityStore;
